Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello Qlik Experts,
I have a question how to display a measure as a dimension in the frontend.
So far I transformed my measure:
IF(((Sum({1<[type]={"sale"},[datum]={">=$(=date(today()-30,'YYYY-MM-DD'))"},[kanal]=$::[kanal],[monat]=$::[monat],[marke_total]=$::[marke_total],[iid]=$::[iid]>}[menge])/30)>'0,14' or
(Sum({1<[type]={"sale"},[datum]={">=$(=date(today()-7,'YYYY-MM-DD'))"},[kanal]=$::[kanal],[monat]=$::[monat],[marke_total]=$::[marke_total],[iid]=$::[iid]>}[menge])/7)>'0,14')
and
IF(
(((Sum({1<[type]={"sale"},[datum]={">=$(=date(today()-7,'YYYY-MM-DD'))"},[kanal]=$::[kanal],[monat]=$::[monat],[marke_total]=$::[marke_total],[iid]=$::[iid]>}[menge])/7) >
(Sum({1<[type]={"sale"},[datum]={">=$(=date(today()-30,'YYYY-MM-DD'))"},[kanal]=$::[kanal],[monat]=$::[monat],[marke_total]=$::[marke_total],[iid]=$::[iid]>}[menge])/30)) and
(Sum({1<[type]={"sale"},[datum]={">=$(=date(today()-7,'YYYY-MM-DD'))"},[kanal]=$::[kanal],[monat]=$::[monat],[marke_total]=$::[marke_total],[iid]=$::[iid]>}[menge])/7)>'0,28'),
(Sum(quantityAvailableOms)/
(Sum({1<[type]={"sale"},[datum]={">=$(=date(today()-7,'YYYY-MM-DD'))"},[kanal]=$::[kanal],[monat]=$::[monat],[marke_total]=$::[marke_total],[iid]=$::[iid]>}[menge])/7)) < $(v_Tage),
(Sum(quantityAvailableOms)/
(Sum({1<[type]={"sale"},[datum]={">=$(=date(today()-30,'YYYY-MM-DD'))"},[kanal]=$::[kanal],[monat]=$::[monat],[marke_total]=$::[marke_total],[iid]=$::[iid]>}[menge])/30)) < $(v_Tage))
and
Sum({1<[kanal]=$::[kanal],[monat]=$::[monat],[marke_total]=$::[marke_total],[iid]=$::[iid]>}[marge_GMO])>'0'
and
Sum({1<[datum]={">=$(=date(today()-60,'YYYY-MM-DD'))"},[kanal]=$::[kanal],[monat]=$::[monat],[marke_total]=$::[marke_total],[iid]=$::[iid]>}[marge_GMO])>'0',
'Yes','No')
to
aggr(Measure, ,Marke, iid, size, Saison) or simple aggr(Measure, Dim1, Dim2, ...)
so it transformed my measure to a dimension
but when I want to set a filter, such as 'NO' in the figure, it still finds me values with Yes. Can someone explain me this phenomenon?
Best regards Phan
'Measure #Dimension # Frontend developement
Hi, this happens because selections can only be done on loaded values of fields, you don't select 'yes' or 'no' in a particular field, you select values in the fields used in the conditional dimension. As you can see in the selection bar there are four fields selected.
So maybe you have a matrix like:
Field1 Field2 Result
A B Yes
B A Yes
B B No
Selecting 'Yes' will select values of the first 2 rows, this is: values A and B on the Field1 and values B and A in field 2, this selections matches the selections needed to show row 3 so it keeps selected
If you need a filter row by it will better if you try to pass this logic to the script, so each row alrady has a yes/No value where you can filter or look for a way where uniqueidentifiers are selected.
Apart from the good explanation from @rubenmarin, take into account that if you pretend Qlik Sense to select the output values corresponding to your expression, and calculate all the associative model that corresponds to those Yes/No values (to show the whites and greys), Qlik Sense would have to make reverse engineering of your expression (ifs, set analysis, filters, etc.). Qlik Sense is smart, but not that smart 😉.
JG