Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hi to all and thank in advance for you time.
I have the following calculations
FieldA | FieldB | time | I need to | |
count( distinct [id] ) | count (distinct total <[time]> [id]) | ???? | ||
ValueA | 70 | 100 | 100 | |
TypeA | 40 | 100 | 10 | |
TypeB | 50 | 100 | 20 | |
TypeC | 60 | 100 | 30 | |
TypeD | 10 | 100 | 40 | |
ValueB | 100 | 100 | 100 | |
TypeA | 10 | 100 | 10 | |
TypeB | 20 | 100 | 20 | |
TypeC | 30 | 100 | 30 | |
TypeD | 40 | 100 | 40 |
I need to have the distinct total for any dimension I expand as in the example
Thank u!
if( dimensionality()=2, count( distinct total <[FieldB], [time]> [id]), count( distinct total <[time]> [id]) )
@jorgie How did you arrive to that values? please share some dummy data with expected output
thanx for replying.
As you can see the logic is on the column headers.
I created the data
thanx again
as per your sample data for Value A and Type A count is 40 but how you want to populate 10.
when i use the Count( Distinct Total <[time]> [customers]) I have the total which is 100 for the dimension of time.
you are right, cant be 10 for 40.
I want in general to have the total of the Type dimension.
@jorgie I still did not understand expected output.
If I understood your question:
Try fiddling around with 'Aggr(nodistinct Count(measure), FieldA, FieldB)' instead on the field(s) you want to group your sum by.
I had a similar issue with trying to produce percentages per each value for a dimension.
Hope this helps.
you did understand it and thank you @M_B !
Unfortunattely partially solves it. I gets me the dimensional count when I expand the dimension. But not the total. If the first level dimension is collapsed I get null values. I tried to use 3 dimensions but then it all got null
I will try to simplify it and for the rest people who got in proccess to help (@Kushal_Chawda and @anat ) which I also thank them.
Hope I got clarified now
Thank you all for your time
PS I will never manage to learn all these things about qlik. How this expression work really @M_B ???
@jorgie why do you need count(distinct total value). Why don't you just use Count(DISTINCT value)
@jorgie if you want just the total to be by other measure try below
=if(dimensionality()=1,
Count(DISTINCT TOTAL <time> value),
Count(DISTINCT value))