Skip to main content
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

re Edwin ,

it should be the last occurrence for a model per user, and category 

edwin
Master II
Master II

just expand teh AGGR then

edwin
Master II
Master II

 
Shinigaloo
Contributor III
Contributor III
Author

ohhh thank you edwin it's worked finally ,

now i have another issue edwin , ive converted your qvw to a bar chart ,and i still have the titles of all the models even if they are empty how display only the titles of last models

here is the  qvw document updated

 

edwin
Master II
Master II

that is how the bar chart works, it will show all the values of the dimensions.  so if model A appears in one date but not in another, it will show it as 0 in a bar chart

edwin
Master II
Master II

also, i dont think a bar chart is the best presentation for this.  once you get a lot of models and dates, the chart will be very busy.  this should be a straight table

Shinigaloo
Contributor III
Contributor III
Author

thank you so much edwin , for your responses

Shinigaloo
Contributor III
Contributor III
Author

i think it's possible to hiden it ive made this

Shinigaloo_0-1607531596798.png

and it works

edwin
Master II
Master II

awesome

 

Shinigaloo
Contributor III
Contributor III
Author

i have another evolution that should be taken into account in my document qvw

my date vary depending on the selected period, it should be  date < vdatefinformat  and date  >vdatedebformat

How can i apply this condition into my expression below

Thank you