Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
vengadeshpalani
Creator
Creator

Need Transform Logic

Hi All,

I have a table like below INPUT format

INPUT

Input.png

what is the best way to transfer above table to get OUTPUT format

Output

output.png

Please find the attachment for Sample Data.

Thanks

Vengadesh PALANI

1 Solution

Accepted Solutions
sunny_talwar

Try this

Table:

LOAD [Event Start Time],

If([Event Start Time] = Previous([Event Start Time]), RangeSum(Peek('NewTime'), 1/48), 0) as NewTime,

Date(Floor([Event Start Time])) as [Event Date],

Time(Frac([Event Start Time]) + If([Event Start Time] = Previous([Event Start Time]), RangeSum(Peek('NewTime'), 1/48), 0)) as [Event Hour],

    Periods,

    If(IterNo() = 1, [First Half an hour usages], [Second Half an hour usages]) as Usages

FROM

[..\..\Downloads\Temp.xlsx]

(ooxml, embedded labels, table is Sheet2)

While IterNo() <= 2;

View solution in original post

1 Reply
sunny_talwar

Try this

Table:

LOAD [Event Start Time],

If([Event Start Time] = Previous([Event Start Time]), RangeSum(Peek('NewTime'), 1/48), 0) as NewTime,

Date(Floor([Event Start Time])) as [Event Date],

Time(Frac([Event Start Time]) + If([Event Start Time] = Previous([Event Start Time]), RangeSum(Peek('NewTime'), 1/48), 0)) as [Event Hour],

    Periods,

    If(IterNo() = 1, [First Half an hour usages], [Second Half an hour usages]) as Usages

FROM

[..\..\Downloads\Temp.xlsx]

(ooxml, embedded labels, table is Sheet2)

While IterNo() <= 2;