Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Highlighted
Not applicable

How to copy values to next 6 fields of a table

14.08.Value Hero383,52

Hi there,

i am new to qlikview and i hope anybody can help me again.

zzz.jpg

I want to build something like this:

If tmpArt = ValueHero, then copy the value from tmpTeilUmsatz to the next 6 following fields.

i.e.:

14.08.   Value Hero     383,52

15.08.Value Hero383,52
16.08.Value Hero383,52
17.08.Value Hero383,52
18.08.Value Hero383,52
19.08.Value Hero383,52
20.08.  Value Hero 383,52

Thanks and best regards,

Sabrina

Tags (5)
15 Replies
MVP
MVP

Re: How to copy values to next 6 fields of a table

Can you please upload the result you are expecting in excel file ?

Not applicable

Re: How to copy values to next 6 fields of a table

Mapping1:

mapping load

    Datum,

    Sum(Umsatz)

resident Deals_Liste

group by Datum;

Mapping2:

mapping load

    Datum,

    Art

resident Deals_Liste;

Plattformen_Details:

LOAD Plattform as Plattform,

     PlattformVJ as Plattform_VJ,

     Datum,

     [Artikel Online] as [Artikel Online],        

     if(ApplyMap('Mapping2',Datum) = 'Value Hero', ApplyMap('Mapping1',Datum)/7 ) as Division,

     [Umsatz in € gesamt] ,

     [Verkaufte Artikel] as [Verkaufte Artikel],

     [Umsatz in € gesamt] as [Umsatz in € gesamt],

     DDMM as DDMM

FROM

   

    (ooxml, embedded labels, table is Qlik_2.de);

   

tmpDeals:

LOAD

    Datum,

    if(ApplyMap('Mapping2',Datum) <> 'Value Hero' and  ApplyMap('Mapping2',Datum) <> 'Daily Deal',0,  ApplyMap('Mapping2',Datum)  ) as tmpArt,

if(ApplyMap('Mapping2',Datum) ='Value Hero', ApplyMap('Mapping1',Datum) / 7, 0) as tmpTeilUmsatz

resident Plattformen_Details;

Not applicable

Re: How to copy values to next 6 fields of a table

Or do you need the excel file i am loading from?

MVP
MVP

Re: How to copy values to next 6 fields of a table

Your script will not help. Upload the excel file please

Not applicable

Re: Re: How to copy values to next 6 fields of a table

Here they are and thanks a lot!!!

Not applicable

Re: How to copy values to next 6 fields of a table

Any Idea?

Not applicable

Re: How to copy values to next 6 fields of a table

Nobody can help me?

I'm racking my head for the last days and i do not go on. 😞

puttemans
Valued Contributor

Re: How to copy values to next 6 fields of a table

Hi,

I didn't work out in detail, but roughly maybe this could work :

1/first you only select those lines where the Value= Value Hero

2/then you autonumber the lines you selected

3/then you build a repetition for each line in order to create your dates

For line 1 to x;   

Set a=null();

     For a = 1 to 7;

          Load

          Num#(Date-1)+$(a) as Date;

          Umsatz as Umsatz       

     Next;

Next;

While you make sure to concatenate all lines. I think that should bring you pretty close to your desired result.


Partner
Partner

Re: How to copy values to next 6 fields of a table

You can use the Peek() to do this.

is it allways 6 values or is it allways all the lines until a new tmpArt?

I'm going to assume the last one because it is a little simpler to implement.

Something like this.

Load .

.

.

if(isnull(tmpArt), Peek(newtmpArt),tmpArt) as newtmpArt,

if(peek(newtmpArt)='ValueHero',Peek(tmpTeilUmsatz),tmpTeilUmsatz) as tmpTeilUmsatz


from Table....