Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
vvira1316
Specialist II
Specialist II

Set analysis to get expected output

Hi,

I'm having challenges to get expected output.

I'm including data file and application for your reference.

Sample Scenario

   

IdProfileIdDIM_FLD1_IdDIM_FLD2_IdDIM_FLD3_IdDIM_FLD4_IdDATE
11027211017/7/2016
21027211114/30/2018
31027211177/18/2018

   

DIM_FLD3_IdBSN
0BSN1
1BSN2
2BSN3
4BSN4
5BSN5
6BSN6

   

DIM_FLD4_IdOSN
0OSN1
1OSN2
2OSN3
3OSN4
4OSN5
5OSN6
6OSN7
7OSN8

Below is Straight Table Chart in QS

   

Data DimData Field IDApplicationEmployeeCountryDepartmentData Max DateID
211027ALN21Employee3United StatesDEPT1997/18/20183
601072ALN60Employee3United StatesDEPT1994/30/20185
681081ALN68Employee4United StatesDEPT414/30/20187
951119ALN95Employee4United StatesDEPT414/30/20189

Requirement

1. Straight table contains all Max (Data Date) Records of each DIM_FLD1_Id.

2. Details in table to include BSN, OFFNM, OSN, etc.

    i.e.in above straight table for Data Dim 21 it should show BSN2, OSN8

3. 30 Day ( Today() - 30   )Aging Detail Table (same as above) and Count of records

    for each DIM_FLD1_Ids Max Date i.e. less than or equal to Today() - 30 but  has no record within last 30 days

Thanks & Regards,

Vijay

1 Solution

Accepted Solutions
sunny_talwar

For 3rd req... add a calculated dimension

=Aggr(If(Max([Data Date]) <= Today() - 30, DIM_FLD1_Id), DIM_FLD1_Id)

and uncheck 'Include null values' under the dimension

or you can use a set analysis for all your expressions

{<DIM_FLD1_Id = {"=Max([Data Date]) <= Today() - 30"}>}

For count... you can try this

=Count(DISTINCT {<DIM_FLD1_Id = {"=Max([Data Date]) <= Today() - 30"}>} DIM_FLD1_Id)

View solution in original post

17 Replies
sunny_talwar

May be use this for your second req...

=FirstSortedValue(BSN, -[Data Date])

=FirstSortedValue(OSN, -[Data Date])

Didn't get the 3rd req... what exactly are you looking to do there?

vvira1316
Specialist II
Specialist II
Author

Hi Sunny,

Thanks a lot!!!

Your suggestion is helping for 2nd request.

                How do I get count for this straight table?

For 3rd request. I'm going try explaining it again.

The detail table will be same as above. Will need count as well.

Record selection criteria changes to following

a)     Record set to be considered will be all records whose Date is <= Today() - 30, now from this only Max Date for  each DIM_FLD1_Id.

b)     DIM_FLD1_Id record should be removed if it has record with Date > Today() - 30

I hope I'm able to explain it.

BR,

Vijay

sunny_talwar

Your suggestion is helping for 2nd request.

                How do I get count for this straight table?

Count for this straight table? Where in a KPI object?

b)     DIM_FLD1_Id record should be removed if it has record with Date > Today() - 30

Not just any date, but the max(Date), right? so Max(Date) >  Today() - 30?

vvira1316
Specialist II
Specialist II
Author

Was thinking of count in a KPI object but both place would be great.

It's PoC I'm working on so not sure what business would eventually like to have, so please advise for both.

The other ask it to find Max Date of each DIM_FLD1_Id where Date is less than Today() - 30, but a DIM_FLD1_Id record should not be displayed or counted if it has another record whose Date is within last 30 days.

sunny_talwar

Was thinking of count in a KPI object but both place would be great.

I mean the count for the first one should be just Count(DISTINCT DIM_FLD1_Id), isn't it?

The other ask it to find Max Date of each DIM_FLD1_Id where Date is less than Today() - 30, but a DIM_FLD1_Id record should not be displayed or counted if it has another record whose Date is within last 30 days.

Oh so, if there is a record within Today() - 30 and Today(), that DIM_FLD1_Id should not be part of the table?

vvira1316
Specialist II
Specialist II
Author

Hi Sunny,

No count is not Count(DISTINCT DIM_FLD1_Id). I'm attaching the table using Max Date that I've. I'm expecting count of 640. ResultSet1.xlsx

Yes for the second part clarification.

sunny_talwar

For 3rd req... add a calculated dimension

=Aggr(If(Max([Data Date]) <= Today() - 30, DIM_FLD1_Id), DIM_FLD1_Id)

and uncheck 'Include null values' under the dimension

or you can use a set analysis for all your expressions

{<DIM_FLD1_Id = {"=Max([Data Date]) <= Today() - 30"}>}

For count... you can try this

=Count(DISTINCT {<DIM_FLD1_Id = {"=Max([Data Date]) <= Today() - 30"}>} DIM_FLD1_Id)

sunny_talwar

Try this... count where Data Date is not null (or is available)

=Count(DISTINCT {<[Data Date] = {"*"}>} DIM_FLD1_Id)

vvira1316
Specialist II
Specialist II
Author

Hi Sunny,

Thanks for all your help.

I'll check and update.

BR,

Vijay