Skip to main content
Oct 16, 2019 10:07 AM UTC
Question

using data filter widget in the label chart

Mr/Mrs, now I have a question: 

this is my code: 

var query =
{
"filters": {
"type": "And",
"filters": [
{
"type": "EQ",
"fieldName": "Department",
"value": "Milk"
},
{
"type": "EQ",
"fieldName": "Kategory",
"value": "Production Volume"
},
{
"type": "EQ",
"fieldName": "SKU",
"value": "Whipping Cream 1000 ml"
}
]
}
};
var result = Resources["InfoTableFunctions"].RenameField({
t: Resources["InfoTableFunctions"].Aggregate({
t: me.QueryDataTableEntries({ maxItems: undefined,
query: query,
values:undefined,
source: undefined,
tags:undefined
}),
columns: 'value',
aggregates: 'SUM',
groupByColumns: 'year'
}),
from: "SUM_value",
to: "value"
});

clipboard_image_0.png

after that, I need do data filter using data filter widget and only show "2019" value. How can I edit this code?

but my value and target is different services. How to figure it out?

5 replies

Oct 21, 2019 9:13 PM UTC

You could use a second stage filtering (or two services)

either first get data based on period selection then apply filter

or vice versa.

xiaoqwAuthor
Oct 22, 2019 2:15 AM UTC

WeChat Screenshot_20191022101341.pngHi @PaiChung,

I try to apply this query into label chart. just change ESL 1000 ml to Whipping Cream 1000 ml.

 
 

but when I bind data filter widget, it is not working. Could you help me to figure it out?

Oct 22, 2019 12:41 PM UTC

Data filter widget if working properly will supply the query in json that you bind to the input parameter of your service

and then filter changed would trigger the service.

perhaps you can log out the query input parameter in your service to see if it is working right?