Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Shinigaloo
Contributor III
Contributor III

The last occurrence of the value of a group dimension

Hello all,

I want to be able to access to a detail distribution of my activated devices by type on a given period of time

What have been done :  i have created a bar chart that display the number of activeated device by device [Catégorie equipement ] and its type [Modèle équipement ] ( see the attached picture)

 
 
 

Measure :  =Count({($<activation_eqt= {">=$(=$(vDateDebFormat))"}>) * ($<activation_eqt= {"<=$(=$(vDateFinFormat))"}>)} distinct ([ID_EQT])) Dimension : group dimension [Device] 

Now the probelem is that for [Modèle équipement ], i want to display only the last occurrence of this field on a given period

 I’ve tried with this measure but it doesn’t worked :  =Count({<[Modèle équipement] = {"$(=FirstSortedValue([Modèle équipement],-Aggr(max({<activation_eqt= {">=$(=$(vDateDebFormat))"}> * <activation_eqt= {"<=$(=$(vDateFinFormat))"}>}activation_eqt), [Modèle équipement])))"}>}  DISTINCT [ID_EQT])

exp :

user1 / categoriA / Modèle équipement AA /12/12/2020   

user1 / categoriA / Modèle équipement bb/13/12/2020   

I would like to display the occurrence with the largest date on the histogram not on the script : 

 user1 / categoriA / Modèle équipement bb/13/12/2020

Could you help me plz it's very urgent.

thx you !! 

 

Labels (4)
29 Replies
Shinigaloo
Contributor III
Contributor III
Author

Now that i have this measure :

measure =Sum(Aggr(If([Date] = Max(TOTAL <[Category], User> Date), Count(Model)), [Date], Category, User))

knowing that my [Date] can vary depending on the selected period , Date sould be always [Date]>= vdatefin and

[Date]<=vdatedeb

how can i add this condition into my measure so that my calcul will vary depending on the values of this 2 variables

Please help me !!

 

edwin
Master II
Master II

pls attach a QVW even with fake data

Shinigaloo
Contributor III
Contributor III
Author

here's the QVW document ,

i've add into it(qvw) : [start date] and [end date] , except that i didn't load data into the two calendars (you can see in the attached field )

now i want that my graphic vary depending on the selected period within this 2 dates [start date ] and [end date]

 so as you can see here , this is my measure :measure =Sum(Aggr(If([Date] = Max(TOTAL <[Category], User> Date), Count(Model)), [Date], Category, User))

 i do want to keep the same functionality but : i have to take the max value per date within the 2 dates selected

edwin
Master II
Master II

looks familiar from another thread

try this, you have two variables which the user enters dates, add the variables in set analysis (see your other thread)  first chart shows results regardless of variables, 2nd chart shows only those between variables.  note that the variables need to be same format as date

Shinigaloo
Contributor III
Contributor III
Author

unfortunately , the measur do no show any result i don't know why ?

edwin
Master II
Master II

edwin_0-1607623737310.png

 

edwin
Master II
Master II

do you not see this?  note that it only picked up dates between start and end date

edwin
Master II
Master II

what results were you expecting?  can you attach an image why you say there are no results?

Shinigaloo
Contributor III
Contributor III
Author

hi edwin ,

Thank you so much it worked for me finally:)

edwin
Master II
Master II

 ok glad it worked out for you