Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Current and Previous values in UI

     Dear Guys,

Need help with the below requirement in UI.

a) Current values are the maximum values in table.

b) For previous values I need a option in UI to compare with current date and limit provided. (For eg: if I select 15, previous value should be compared between max date to 15th of that particular month)

Input:

NameRow IDEmployee IDlast_modified_date_timeSLAOTD
A442231/10/2017 23:45
B442215/11/2017 16:38green
C442214/11/2017 17:32green3
D442215/11/2017 17:34green3
E442215/11/2017 17:36green3
F442217/11/2017 17:39red3
G442222/11/2017 12:34red3

Output:

        

Row IDNameprev_perfrocurr perfprev_control_statuscurrent_control statuschanged dateprev chagened date
44Ggreenred3322/11/2017 12:34

15/11/2017 17:3

Note:

17 Replies
sunny_talwar

Can you explain the output when vInput = 17? I am not sure how is row with RowID 44 getting populated?

Anonymous
Not applicable
Author

Thanks for pointing out. There is a typo error in output table when vInput=17. Previous SLA will be blank for Rowi 44 and 33 (i.e. same as Previous OTD  and Previous last_modified_date_time).


Eg: Row ID=14 and Employee ID=22 when vInput=17

We need to check if there is any change between 17/11/2017 (including time stamp) to current available date (i.e. 22/11/2017 12:34). As per the data there is no records with change in SLA, so it's should be blank or shown as No Change).

Output Table (vInput=17):

Row IDNameEmployee IDPrevious SLACurrent SLAPrevious OTDCurrent OTDCurrent last_modified_date_timePrevious
last_modified_date_time
FPRPriority
           44G22 red 322/11/2017 12:34 No3
33F23 red 317/11/2017 17:39 No1
11H44redgreen4425/11/2017 12:3417/11/2017 17:32No1
Anonymous
Not applicable
Author

Can you please have a look and let me know if any information is required.

sunny_talwar

Try attached

Dimension

Row ID

Expressions

Name

FirstSortedValue(Name, -last_modified_date_time)


Employee ID

=[Employee ID]


Previous SLA

FirstSortedValue({<Date = {"$(='>=' & Date(MakeDate(Year(Max(Date)), Month(Max(Date)), vInput)))"}>}SLA, -last_modified_date_time, 2)


Current SLA

FirstSortedValue(SLA, -last_modified_date_time)

Previous OTD

FirstSortedValue({<Date = {"$(='>=' & Date(MakeDate(Year(Max(Date)), Month(Max(Date)), vInput)))"}>}OTD, -last_modified_date_time, 2)

Current OTD

FirstSortedValue(OTD, -last_modified_date_time)

Current last_modified_date_time

=TimeStamp(Max(last_modified_date_time))

Previous last_modified_date_time

=TimeStamp(Max({<Date = {"$(='>=' & Date(MakeDate(Year(Max(Date)), Month(Max(Date)), vInput)))"}>}last_modified_date_time, 2))

When vInput is 15

Capture.PNG

When vInput is 17

Capture.PNG

Anonymous
Not applicable
Author

Hi Sunny,

The chart is showing all the the values with respect to previous max available times stamp, but not based on previous modified SLA.

I have just changed one record in input data to have a look.

Existing:

E, 44, 22, 15/11/2017 17:38, green, 1, No, 3

New (Just changed green to red)

E, 44, 22, 15/11/2017 17:38, red, 1, No, 3

Output (vInput is 15):

Row ID Employee ID Name Previous SLA Current SLA Previous OTD Current OTD Current last_modified_date_time Previous last_modified_date_time
4422Gredred1322/11/2017 12:3415/11/2017 17:38

Here Previous SLA and Current SLA are same (i.e. red)

Expected Output (vInput=15):

Row ID Employee ID Name Previous SLA Current SLA Previous OTD Current OTD Current last_modified_date_time Previous last_modified_date_time
4422Ggreenred 322/11/2017 12:3415/11/2017 16:38

Can you please have a look.

sunny_talwar

Try the attached

Anonymous
Not applicable
Author

Thanks Sunny. Previous SLA and Previous OTD are getting changed as expected. But Previous last_modified_date_time is getting displayed for all the cases.

Output (vInput=15): This is showing correct previous last_modified_date_time

Row ID Employee ID Name Previous SLA Current SLA Previous OTD Current OTD Current last_modified_date_time Previous last_modified_date_time
4422Ggreenred 322/11/2017 12:3415/11/2017 16:38
3323Fgreenred3317/11/2017 17:3915/11/2017 17:39
1144Hredgreen4425/11/2017 12:3417/11/2017 17:32

Output (vInput=17): This must display blank previous last_modified_date_time as there is not change in Previous SLA.

Row ID Employee ID Name Previous SLA Current SLA Previous OTD Current OTD Current last_modified_date_time Previous last_modified_date_time
4422G red 322/11/2017 12:3415/11/2017 16:38
3323F red 317/11/2017 17:3915/11/2017 17:39
1144Hredgreen4425/11/2017 12:3417/11/2017 17:32

Can you please have a look.

sunny_talwar

Hahahahaha, is there any other changes you would like me to make sir?

Capture.PNG